// pages/me/me.js
const app = getApp();
Page({
  // 页面的初始数据
  data: {
    userInfo: null,
  },

  onShow(options) {
    var user = app.globalData.userInfo
    if (user && user.name) {
      console.log('个人中心页user', user)
      this.setData({
        user: user,
      })
    } else {
      this.setData({
        user: wx.getStorageSync('user'),
      })
    }

  },

  // 退出登录
  loginOut() {
    wx.redirectTo({
      url: '/pages/login/login',
    })
  },
  //去我的预约页
  goMyOrder() {
    wx.navigateTo({
      url: '/pages/order-record/order-record',
    })
  },
  //去我的教室预约页
  goMyOrderClass() {
    wx.navigateTo({
      url: '/pages/class-order-record/class-order-record',
    })
  },
})